// Account
@import "../variables";

.account {

  &__nav {
    float: left;
    width: 220px;
    padding-top: 25px;

    .nav__section {
      position: relative;
      padding: 25px 20px 42px 0;
      overflow: hidden;

      &:after {
        position: absolute;
        content: "";
        width: 200px;
        height: 1px;
        background-color: #CCCCCC;
        right: 14px;
        bottom: 0;
      }
    }

    .avatar {
      float: left;
      width: 100px;
      height: 100px;
      margin-right: 10px;
      border-radius: 100px;
      border: 2px solid #fff;
  
      > img {
        display: block;
        width: 100%;
        height: auto;
      }
    }
  
    .account-info {
      overflow: hidden;
  
      > .name {
        margin-top: 0;
        margin-bottom: 28px;
        font-size: 18px;
        color: $primary;
        line-height: (24 / 18);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
    }
  
    .setting {
      margin-top: 0;
      margin-bottom: 20px;
      font-size: 20px;
      font-weight: 400;
      line-height: 26px;
  
      &-list {
        margin-bottom: 0;
        padding-left: 0;
        list-style: none;
  
        > li {
          margin-bottom: 14px;
  
          &:last-child {
            margin-bottom: 0;
          }
  
          > a {
            display: block;
            font-size: 18px;
            color: #777777;
            line-height: (24 / 18);
            text-decoration: none;
  
            .icon:first-child {
              margin-right: 18px;
            }
          }
  
          > a:hover,
          &.active > a {
            color: $primary;
          }
        }
      }
    }
  }

  &__content {
    overflow: hidden;
    margin-bottom: 56px;

    .page-title {
      margin-top: 55px;
      margin-bottom: 22px;
      font-size: 30px;
      font-weight: 400;
      line-height: 1;
      color: $primary;
    }

    .content__inner {
      min-height: 628px;
      padding: 70px 110px 130px 100px;
      background-color: #fff;
    }

    .user-panel {
      margin-bottom: 38px;
      overflow: hidden;

      &__portrait {
        float: left;
        width: 96px;
        height: 96px;
        margin-right: 16px;
        border-radius: 96px;
        overflow: hidden;

        > img {
          display: block;
          width: 100%;
          height: auto;
        }
      }

      &__username {
        margin-top: 37px;
        margin-bottom: 0;
        font-size: 16px;
        white-space: nowrap;
      }

      &__user {
        .info-group {
          margin-left: 0;
          margin-right: 0;
          margin-bottom: 30px;

          > .control-label {
            float: left;
            width: 50px;
            margin-right: 20px;
            padding-top: 13px;
            text-align: right;
            font-size: 16px;
            font-weight: 400;
            line-height: 1;
          }

          .form-control {
            width: 230px;
          }
        }

        .gender-group {
          > .control-label {
            padding-top: 25px;
          }

          .gender {
            float: left;
            display: block;
            margin-right: 30px;
          }
        }
      }

      &__submit {
        margin-left: 70px;
      }
    }

    .security {
      &.content__inner {
        padding: 0 66px 28px;
      }

      &__manifest {
        margin: 0;
        padding: 0;
        list-style: none;

        .manifest__item {
          padding: 25px 0;
          font-size: 16px;
          border-bottom: 1px solid #CCCCCC;
          overflow: hidden;

          .security-level {
            margin-bottom: 12px;

            .level__ranks {
              margin-right: 24px;
            }
          }

          .item__icon, .item__head, .item__body {
            float: left;
            margin-right: 20px;
          }

          .item__right {
            float: right;
          }

          .item__body {
            color: #9B9B9B;
          }
        }
      }
    }

    .amending {
      &.content__inner {
        padding: 45px 50px 75px;
        min-height: auto;
      }

      &__steps {
        padding-left: 134px;
        padding-right: 134px;
      }

      &__stepanel {
        position: relative;
        padding: 30px 273px 58px 243px;

        &.tradepass {
          padding-left: 150px;
          padding-right: 150px;

          .amending__submit {
            padding-left: 210px;
          }
        }

        .stepanel__arrow {
          &.first {
            left: 166px;
          }
          &.second {
            left: 426px;
          }
          &.third {
            left: 686px;
          }
        }
      }

      &__submit {
        margin-top: 30px;

        > .btn {
          vertical-align: bottom;
        }

        .notice {
          color: #9B9B9B;
          font-size: 16px;
        }
      }

      .input-group .form-control:last-child {
        border-left: 0;
      }

      .input-group-addon {
        padding-left: 9px;
        padding-right: 7px;
        border-radius: 0;
        border: 1px solid #C2CFEA;
        background-color: #F6F9FF;
      }
    }
  }
}

.security-level {
  font-size: 14px;
  line-height: (19 / 14);

  .level {
    &__title {
      margin-top: 0;
      margin-bottom: 8px;
      color: #9B9B9B;

      &.lg {
        margin-bottom: 19px;
        font-size: 18px;
        color: #2F3032;
      }
    }
  
    &__inner {
      color: #2F3032;
    }

    &__ranks {
      float: left;
      margin-bottom: 0;
      margin-right: 5px;
      padding-left: 0;
      padding-top: 2px;
      list-style: none;
      overflow: hidden;

      > li {
        float: left;
        width: 22px;
        height: 14px;

        &:nth-child(1) {
          background-color: #e4e4e4;
        }

        &:nth-child(2) {
          background-color: #D8D8D8;
        }

        &:nth-child(3) {
          background-color: #CFCFCF;
        }

        + li {
          margin-left: 2px;
        }
      }


      $level-list-descriptors: (low: $danger, medium: $warning-dark, high: $success);
      $level-list-keys: map-keys($level-list-descriptors);
      @each $key in $level-list-keys {
        $idx: index($level-list-keys, $key);
        $color: map-get($level-list-descriptors, $key);
        &.#{$key} > li:nth-child(-n+#{$idx}) {
          background-color: $color;
        }
      }
    }

    &__notice {
      margin-top: 13px;
      color: #9B9B9B;
    }
  }
}

.gender {
  display: inline-block;
  position: relative;
  width: 66px;
  height: 66px;
  margin-bottom: 0;
  overflow: hidden;
  cursor: pointer;
  font-weight: 400;
  background-color: #9B9B9B;

  &__inner {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
  }

  &__icon {
    &, &--active {
      display: block;
      width: auto;
      height: 100%;
      margin: auto;
    }

    &--active {
      display: none;
    }
  }

  &__label {
    position: absolute;
    right: 0;
    bottom: 0;
    font-size: 16px;
    font-weight: 400;
    line-height: 1;
    color: #777777;
    z-index: 0;

    &:before,
    &:after {
      position: absolute;
      content: '';
      right: 0;
      border-left: 0;
      border-bottom: 0;
      z-index: -1;
    }

    &:after {
      border-right: 33px solid #CCCCCC;
      border-top: 33px solid transparent;
      top: 16px - 33px;
    }

    &:before {
      border-right: 34px solid transparent;
      border-top: 34px solid transparent;
      top: 16px - 34px;
      z-index: -2;
    }

    &--lg {
      &:after {
        border-right-width: 52px;
        border-top-width: 42px;
        top: 16px - 42px;
      }

      &:before {
        border-right-width: 53px;
        border-top-width: 43px;
        top: 16px - 43px;
      }
    }
  }

  > input[type="radio"] {
    position: absolute;
    left: -999px;
    top: -999px;
    visibility: hidden;

    &:checked {
      ~ .gender__inner {
        background-color: $warning-dark;

        .gender__icon {
          display: none;

          &--active {
            display: block;
          }
        }
  
        .gender__label {
          color: #fff;
  
          &:after {
            border-right-color: $primary;
          }

          &:before {
            border-right-color: #fff;
          }
        }
      }
    }
  }

  &.confidentiality {
    > input[type="radio"]:checked {
      ~ .gender__inner {
        background-color: #9B9B9B;

        .gender__label:before {
          border-right-color: transparent;
        }
      }
    }
  }
}

.face-detect {
  &__img {
    margin: 35px auto 55px;
    width: 176px;
    height: 104px;

    > img {
      display: block;
      width: 100%;
      height: auto;
    }
  }

  &__desc {
    font-size: 18px;
    text-align: center;
    color: #9B9B9B;
  }
}
